-
Notifications
You must be signed in to change notification settings - Fork 120
MapFindFeature: Exclude hidden and protected objects #2371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The 'Find next' search failed if the object query returned an object with either a hidden or protected symbol since these kind of objects can't be added to an object selection. Exclude all hidden and protected objects from the 'Find next' and 'Find all' search.
|
For the 'Find all' mechanism the hidden and protected objects were just ignored when adding to the object selection, whereas for the 'Find next' mechanism the outcome depended on the internal order of the objects: FindObjects_Issue2371.mp4 |
|
Yeah, I got the problem. I'm a little bit slow with reviewing the changes 🙈 |
|
Made It is a little bit irritating that objects with protected symbols are skipped. But this can't be changed easily now. The PR is an improvements nevertheless. |
|
@dg0yt: adding the |
src/gui/map/map_find_feature.cpp
Outdated
| } | ||
| }; | ||
| map->getCurrentPart()->applyOnMatchingObjects(search, std::cref(query)); | ||
| map->getCurrentPart()->applyOnAllObjects(search); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverting part of my change here: The current object might no longer match the query, but we still want to see it when determining the next match.
|
@dg0yt: I'm adding a test case. |
|
I will probably revert most of b0dcb5a. |
|
I decided to not create another separate file but to add the test case to |
No slot markup, member functions are good enough. No const on functions which hand out non-const member. Restore original order in header which matched order in source. Move the new functions for testing purpose from public to protected. The test can access them via light-weight derived type.
|
Thank you Kai for refactoring my test code! BTW: tools_t.cpp was the file I also had in mind to put the test in and from which I tried to take over some code. |
|
The last commit is the result of being forced into refactoring... We can make the testable functions public because they only need the controller and query, not the object state. (They might be member functions of controller, but you know ... I don't want to add more capabilities to that class.) |
|
@dg0yt: I checked the code once more and everything looks good to me. I really like the clear structure and especially the |
There is a status message, but it hardly visible at the moment.
|
A few more twists. |
|
I tested the final version and reviewed the code once again, everything now really looks good and works as intended. Thank you Kai for spending the effort. |
This entry is for searching with the dialog hiding parts of the map. There used to be also shortcuts IIRC. |
|
Thanks Matthias. |
The 'Find next' search failed if the object query returned an object with either a hidden or protected symbol since these kind of objects can't be added to an object selection.
Exclude all hidden and protected objects from the 'Find next' and 'Find all' search.